package cn.edu.xmu.orderpayment.order.microservice.vo;

import cn.edu.xmu.orderpayment.order.model.enums.ActState;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.ZonedDateTime;
import java.util.List;

/**
 * @Author: Li Yixuan 22920192204232
 * @Date: 2021/12/19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GrouponActRetVo {
    private Long id;
    private String name;
    private Long shopId;
    private String shopName;
    private List<GroupOnStrategyRetVo> strategy;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "uuuu-MM-dd'T'HH:mm:ss.SSSZZZZZ")
    private ZonedDateTime beginTime;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "uuuu-MM-dd'T'HH:mm:ss.SSSZZZZZ")
    private ZonedDateTime endTime;
    private Byte state;


    public ActState getState() {
        return ActState.getActStateByCode(Integer.valueOf(state));
    }

    public void setState(ActState state) {
        this.state=state.getCode().byteValue();
    }


}
